package com.ceac.kronos.ejb.entitybeans;

import com.ceac.kronos.ejb.entitybeans.Competition;

import com.ceac.kronos.ejb.entitybeans.Participant;

import java.io.Serializable;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@NamedQueries({
  @NamedQuery(name = "Time.findAll", query = "select o from Time o")
})
@Table(name = "TIMES")
public class Time implements Serializable {
    @JoinColumn(name="CHECKPOINT_ID", referencedColumnName = "CHECKPOINT_ID")
    @OneToOne(targetEntity = Checkpoint.class)
    private Checkpoint checkpoint;
    @Column(name="CREATED_BY")
    private Integer createdBy;
    @Column(name="CREATION_DATE")
    private Timestamp creationDate;
    @Column(name="LAST_UPDATED_BY")
    private Integer lastUpdatedBy;
    @Column(name="LAST_UPDATE_DATE")
    private Timestamp lastUpdateDate;

    @OneToOne(targetEntity = Participant.class)
    @JoinColumn(columnDefinition = "PARTICIPANT_ID", referencedColumnName = "PARTICIPANT_ID")
    private Participant participant;
    @Id
    @Column(name="TIME_ID", nullable = false)
    private Integer timeId;
    @Column(name="TIME_STAMP", nullable = false)
    private Timestamp timeStamp;

    public Time() {
    }

    public Time(Checkpoint checkpoint, Integer createdBy,
                Timestamp creationDate, Timestamp lastUpdateDate,
                Integer lastUpdatedBy, Participant participant, Integer timeId,
                Timestamp timeStamp) {
        this.checkpoint = checkpoint;
        this.createdBy = createdBy;
        this.creationDate = creationDate;
        this.lastUpdateDate = lastUpdateDate;
        this.lastUpdatedBy = lastUpdatedBy;
        this.participant = participant;
        this.timeId = timeId;
        this.timeStamp = timeStamp;
    }

    public Integer getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

    public Timestamp getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Timestamp creationDate) {
        this.creationDate = creationDate;
    }

    public Integer getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(Integer lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Timestamp getLastUpdateDate() {
        return lastUpdateDate;
    }

    public void setLastUpdateDate(Timestamp lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }

    public Integer getTimeId() {
        return timeId;
    }

    public void setTimeId(Integer timeId) {
        this.timeId = timeId;
    }

    public Timestamp getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Timestamp timeStamp) {
        this.timeStamp = timeStamp;
    }

    public void setParticipant(Participant participant) {
        this.participant = participant;
    }

    public Participant getParticipant() {
        return participant;
    }

    public void setCheckpoint(Checkpoint checkpoint) {
        this.checkpoint = checkpoint;
    }

    public Checkpoint getCheckpoint() {
        return checkpoint;
    }
}
